// API配置文件
// 根据环境变量选择不同的API基础URL
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:8080/api';

// 请求超时时间（毫秒）
export const REQUEST_TIMEOUT = 10000;

// API路径常量
export const API_PATHS = {
  // 动漫相关
  ANIME: {
    RANKING: '/anime/rank/monthly',
    BY_ID: '/anime/:id',
    SEARCH: '/anime/search',
    NOMINATE: '/anime/nominate/:animeId',
    ALL: '/anime/queryPage' // 使用search路径，允许未登录访问全部动漫数据
  },
  // 用户相关
  USER: {
    LOGIN: '/user/login',
    LOGOUT: '/user/logout',
    REGISTER: '/user/register',
    CURRENT: '/user/current'
  },
  // 投票相关
  VOTE: {
    VOTE: '/vote',
    COUNT: '/vote/count/:animeId',
    USER_LIST: '/vote/user/list'
  },
  // 提名相关
  NOMINATIONS: '/anime/nominations',
  // 收藏相关
  FAVORITE: {
    ADD: '/favorite/:animeId',
    REMOVE: '/favorite/:animeId',
    CHECK: '/favorite/check/:animeId',
    USER_LIST: '/favorite/user/list',
    COUNT: '/favorite/count/:animeId',
    BATCH_CHECK: '/favorite/batch-check'
  },
  // 用户活动相关
  ACTIVITY: {
    LATEST: '/activity/latest'
  },
  // 豆瓣相关
  DOUBAN: {
    SEARCH: '/douban/search',
    DETAIL: '/douban/detail',
    IMAGE_PROXY: '/douban/image-proxy'
  }
};